<template>
    <div id="introduced" style="overflow: hidden;">
      <!--搜索-->
      <div class="searchWrap">
        <div class="searchCenter">
          <p @click="goSearch()">{{searchText}}</p>
        </div>
      </div>
      <!--筛选-->
      <screen></screen>
      <!--商铺类表-->
      <div class="shopMode">
        <div v-for="(item,index) in currentContent" @click="goDetail(item.id)" :key="index">
          <shopList :businessImg="item.businessImg" :name="item.name" :city="item.city" :area="item.area" :briefly="item.briefly"></shopList>
        </div>
        <p class="noMore">没有更多了</p>
      </div>
      <!--版权-->
      <div class="copyRight">
        <p>找玩网</p>
        <p>五朵云.休闲农旅全场景运营服务商 版权所有</p>
      </div>
      <wxParse :content="article"/>
    </div>
</template>

<script>
import shopList from '../../components/shopList'
import screen from '../../components/screen'
import wxParse from 'mpvue-wxparse'
export default {
  name: "index",
  data () {
    return {
      searchText: '千家优质商户、为你服务',
      currentContent: this.$store.state.order,
      article: ''
    }
  },
  components: {
    shopList,
    screen,
    wxParse
  },
  methods: {
    goSearch: function(){
      wx.navigateTo({
        url: '/pages/index/goSearch/main'
      })
    },
    goDetail: function(id){
      wx.navigateTo({
        url: '/pages/index/shopDetail/main?id='+id
      })
    },
    onLaunch: function() {

      wx.login({
        success: function(res) {
          if (res.code) {
            //发起网络请求
            console.log(res.code);
            wx.request( {
              url: "http://192.168.1.120:8888/wx/login/",
              // http://192.168.1.252:8083/p/tianfupay/toPayWay?totalPrice=32.00&orderCode=&memberId=627&payType=1
              // 192.168.1.125:8086/wx/login
              data: {
                data: {
                  token: res.code
                }
              },
              header: {
                  'content-type': 'application/json;charset=utf-8' // 默认值
              },
              method: "POST",
              success: function( res ) {
                  console.log(res);
              },
              error: function (res) {
                  console.log(res);
              }
            })
          } else {
            console.log('登录失败！' + res.errMsg)
          }
        }
      });

    }
  },
  computed: {

  },
  onLoad: function (option) {
      this.article = ""
  },
  created () {
    // 调用应用实例的方法获取全局数据
    // this.onLaunch();
  }
}
</script>

<style scoped lang=scss>
  @import url("~mpvue-wxparse/src/wxParse.css");
  #introduced{
    border-top: 1rpx solid #f5f5f5;
  }

  .searchWrap{
    height:95rpx;
    width:100%;
    background:#ffffff;
    margin:0;
    padding-top:15rpx;
    .searchCenter{
      height: 80rpx;
      width: 80%;
      margin: 0 auto;
      border-radius: 80rpx;
      background: url("../../../static/images/searchIco.png") no-repeat #ececec;
      background-position: 33rpx 22rpx;
      p{
        margin-left: 91rpx;
        background: #ececec;
        font-size: 28rpx;
        color: #999999;
        width:75%;
        float:left;
        margin-top:24rpx;
      }
    }
  }


  .shopMode{
    background: #ffffff;
    padding-bottom: 10rpx;
    margin: 0;
    overflow: hidden;
    .noMore{
      text-align: center;
      height: 50rpx;
      line-height: 50rpx;
      font-size: 24rpx;
      margin-top: 20rpx;
      color: #999999;
    }
  }

  .copyRight{
    text-align: center;
    font-size: 24rpx;
    color: #999999;
    padding: 35rpx 0;
    background: #f5f5f5;
    margin-top: 35rpx;
    p{
      height: 46rpx;
      line-height: 46rpx;
    }
  }

</style>
